# _*_ coding: utf-8 _*_
from odoo.osv import expression
from odoo import models, fields, api


class ResUsers(models.Model):
    _inherit = "res.users"

    @api.model
    def _name_search(self, name, domain=None, operator='ilike', limit=None, order=None):
        user_ids = super()._name_search(name, domain, operator, limit, order)
        if not user_ids:
            user_ids = self._search(expression.AND([[('employee_id.code', operator, name)], domain]), limit=limit, order=order)
        return user_ids
